﻿using UnityEngine;
using System.Collections;

public class WorldFieldSource : MonoBehaviour {

	public float str = 1;
	public float range = 100;
	public float exponent = 2;

	public float getIntensity (float distance) {
		if (distance >= range) return 0;
		float f = 1;
		if (range > 0) f = Mathf.Clamp01 (Mathf.Pow(1.0f - distance/range, exponent));
		return f * str;
	}

}
